/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from './upload';
import { UploadFileParams } from '/#/axios';
import { AxiosProgressEvent } from 'axios';

const { ctxPath,adminPath } = useGlobSetting();

export interface btdmBoxMain extends BasicModel<btdmBoxMain> {
  'hid.djno'?: string; // 导入批号
 
}


export const btdmBoxDetailsListData = (params?: btdmBoxMain | any) =>
  defHttp.post<Page<btdmBoxMain>>({ url: adminPath + '/btdm/btdmBoxMain/btdmBoxDetailsListData', params });

export const mainListData = (params?: btdmBoxMain | any) =>
  defHttp.post<Page<btdmBoxMain>>({ url: adminPath + '/btdm/btdmBoxMain/mainListData', params });

export const btdmBoxMainImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/btdm/btdmBoxMain/importData',
      onUploadProgress,
    },
    params,
  );

export const updatePoCodeBatch = (params?: any) =>
  defHttp.post<btdmBoxMain>({ url: adminPath + '/btdm/btdmBoxMain/updatePoCodeBatch', params});

export const delBatch = (params?: btdmBoxMain | any) =>
  defHttp.get<btdmBoxMain>({ url: adminPath + '/btdm/btdmBoxMain/delBatch', params });
